#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long LL;

const int N = 20, mod = 1e9 + 7;

LL n, m;
LL A[N];
LL down = 1;


LL qmi(LL a, LL b, LL p){
    LL res = 1;
    while(b){
        if(b & 1) res = res * a % p;

        a = a * a % p;
        b >>= 1;
    }
    return res;
}


LL C(LL a, LL b){
    if(a < b) return 0;
    LL up = 1;
    for(LL i = a; i > a - b; i --) up = i % mod * up % mod;

    LL res = up * down % mod;
    return res;
}


int main(){



    cin >> n >> m;
    for(int i = 0; i < n; i ++) cin >> A[i];

    for(int i = 1; i < n; i ++) down = down * i % mod;
    down = qmi(down, mod - 2, mod);
    // cout << down << '\n';
    
    LL res = 0;
    for(int i = 0; i < 1 << n; i ++){
        LL up = m + n - 1;
        int sign = 1;
        for(int j = 0; j < n; j ++){
            if(i >> j & 1){
                up -= A[j] + 1;
                sign *= -1;
            }
        }
        res = (res + C(up, n - 1) * sign) % mod;
    }

    cout << (res + mod) % mod << '\n';

    return 0;
}
